/**
 * ipassbook 0.6.0
 * Copyright (C)2009 wateray and contributors
 * wateray@gmail.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package com.wateray.ipassbook.ui.widget;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JTextField;

/**
 * @author wateray
 * @create 2009-6-1
 */
public class NumberTextField extends JTextField implements KeyListener{

	private static String[] numbers = {"0","1","2","3","4","5","6","7","8","9", "."};
	public NumberTextField() {
        super();
        this.addKeyListener(this);
    }
	
	public NumberTextField(String text) {
        super(text);
        this.addKeyListener(this);
    }
	
    public NumberTextField(int columns) {
    	super(columns);
    	this.addKeyListener(this);
    }
    
    public NumberTextField(String text, int columns) {
    	super(null, text, columns);
    	 this.addKeyListener(this);
    }
    
	@Override
	public void keyPressed(KeyEvent e) {
		// TODO Auto-generated method stub
		int keyCode = e.getKeyCode();
		switch(keyCode){
		case KeyEvent.VK_0:
			
		}
	}

	@Override
	public void keyReleased(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void keyTyped(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}

}
